<?php
ImportClass('export_doc');

$sql_select     = "select * from tblnewsletter_email order by cEmail";
$rs             = $dbsql->query($sql_select);

$doc = new clsMsDocGenerator();
$styles=array('font-size'=>'11pt','font-family'=>'Calibri','border-bottom'=>'1px solid');
$doc->setFontFamily('Calibri');
$doc->setFontSize('11');
$doc->addClass('bold',array('font-weight'=>'bold'));
$doc->startTable(array('border'=>'1px solid'));

$doc->addTableRow(array('Email','Name'), null, null,$styles,'bold',array('40%','60%'));
while($result = $dbsql->fetch_array($rs))
{
    $doc->addTableRow(array($result['cEmail'],$result['cName']), null, null,$styles,null);
}
$doc->endTable();
$doc->output('emails_newsletter.doc');
exit;
?>